Ce notebook est une analyse acoustique des diphtongues descendantes en mandarin standard, en appliquant la modélisation GAMMs (Generated Additive Mixed Models).

#install.packages('rmarkdown')
# Importation des emballages 
#install.packages("itsadug")
library(nlme)
library(ggplot2)
library(mgcv)
library(itsadug)
source("gamm_hacks.r")
#install.packages("tidyverse")
library(tidyverse)

Après l’importation des emballages, nous lisons les bases de données en format .tsv.

# Importation des données 

au <- read.table(file="au0a.tsv",sep="\t", fileEncoding = 'UTF-16', header = TRUE)
ai <- read.table(file="ai0a.tsv",sep="\t", fileEncoding = 'UTF-16', header = TRUE)
ei <- read.table(file="ei0a.tsv",sep="\t", fileEncoding = 'UTF-16', header = TRUE)
ou <- read.table(file="ou0a.tsv",sep="\t", fileEncoding = 'UTF-16', header = TRUE)

Changement de nature des variables des bases de données.

Le critère du changement est que toutes les variables numériques sont numérées et toutes les chaînes de caractère sont factorées.

/ai/

La première diphtongue à analyser est /ai/.

ai$sexe<-as.factor(ai$sexe)
ai$ton<-as.factor(ai$ton)
ai$pow<-as.factor(ai$pow)
ai$contexte.D<-as.factor(ai$contexte.D)
ai$contexte.G<-as.factor(ai$contexte.G)

ai$f1<-as.numeric(ai$f1)
NAs introduced by coercion
ai$f2<-as.numeric(ai$f2)
NAs introduced by coercion
ai$f3<-as.numeric(ai$f3)
NAs introduced by coercion
ai$f0<-as.numeric(ai$f0)
NAs introduced by coercion

Nous voyons la tête du fichier de /ai/.

head(ai)

Dans la base de données, nous pouvons remarquer les variables basiques dans les colonnes numero, sexe, locuteur, diphtongue ; les variables catégorielles comme ton, pow (position dans le mot), contexte.G et contexte.D (les consonnes précédentes et suivantes) ; et les variables numériques comme duree.ms, f0, f1, f2 et f3. Chaque diphtongue est mesurée par 11 points temporels à intervalle égale (0%, 10%, 20%, …, 100%).

# Regroupement par les sexes
ai.mas <- droplevels(subset(ai,sexe=="M"))
ai.fem <- droplevels(subset(ai,sexe=="F"))

Masculin

Nous allons voir les données des locuteurs.

F1

Avant de lancer les modèles, nous voyons les trajectoires de f1 avec les tons différents, avec la considération des sexes et de la durée.

ggplot(ai.mas, aes(x=measurement.no, y=f1, group=numero,
                     alpha=duree.ms.)) +
  facet_grid(~ton) + geom_line()

Modèles de base

Le premier modèle est avec un smooth basic de ton 1 et de smooths de différence.

ai.mas$ton.ord <- as.ordered(ai.mas$ton)
contrasts(ai.mas$ton.ord) <- "contr.treatment"
ai.mas.gam.diff <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                        s(measurement.no, by=ton.ord, bs="cr"),
                      data=ai.mas, method="ML")
summary.coefs(ai.mas.gam.diff)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   508.92      20.76  24.514  < 2e-16 ***
ton.ord2      120.43      22.33   5.393 8.47e-08 ***
ton.ord3      173.89      23.07   7.536 1.01e-13 ***
ton.ord4      109.93      21.51   5.110 3.81e-07 ***

Approximate significance of smooth terms:
                             edf Ref.df      F  p-value    
s(measurement.no)          4.434  5.392  5.263 5.67e-05 ***
s(measurement.no):ton.ord2 1.017  1.032 10.413  0.00111 ** 
s(measurement.no):ton.ord3 1.001  1.002  4.728  0.02980 *  
s(measurement.no):ton.ord4 3.570  4.385  7.968 1.47e-06 ***

Ensuite les plots des prédictions et de smooth de différence entre les tons.

plot_smooth(ai.mas.gam.diff, view="measurement.no",
            plot_all="ton.ord", rug=F)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 

plot_diff(ai.mas.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    0.000000 - 2.020202
    4.040404 - 7.070707

plot_diff(ai.mas.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","3")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    2.323232 - 10.000000

plot_diff(ai.mas.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("3","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    0.000000 - 2.929293
    6.969697 - 10.000000

Analyse : Selon les images, les trajactoires de f1 dans les 4 tons peuvent généralement être différentes significativement, à l’excepetion de celles des ton 3 et 4, qui ne sont pas différentes significativement dans la portion centrale.

Maintenant nous tenons compte de l’influence de duree.ms sur les trajactoires.

ai.mas.gam.dur <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                              s(duree.ms., bs="cr") +
                              ti(measurement.no, duree.ms.) +
                              s(measurement.no, by=ton.ord, bs="cr"),
                         data=ai.mas, method="ML")
summary.coefs(ai.mas.gam.dur)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   521.48      20.47  25.471  < 2e-16 ***
ton.ord2       96.33      22.45   4.291 1.94e-05 ***
ton.ord3      174.32      22.42   7.777 1.74e-14 ***
ton.ord4       97.59      21.32   4.578 5.25e-06 ***

Approximate significance of smooth terms:
                               edf Ref.df     F  p-value    
s(measurement.no)            4.526  5.458 2.689   0.0153 *  
s(duree.ms.)                 5.581  6.507 5.202 3.61e-05 ***
ti(measurement.no,duree.ms.) 7.258  9.082 4.050 3.73e-05 ***
s(measurement.no):ton.ord2   2.838  3.498 7.788 1.66e-05 ***
s(measurement.no):ton.ord3   2.279  2.815 3.364   0.0173 *  
s(measurement.no):ton.ord4   4.009  4.879 6.286 1.52e-05 ***

Les plots avec la considération de la durée.

plot_smooth(ai.mas.gam.dur, view="measurement.no", cond=list(duree.ms.=170),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 170. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.gam.dur, view="measurement.no", cond=list(duree.ms.=80),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 80. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.mas.gam.dur, view=c("measurement.no","duree.ms."),
        ylim=quantile(ai.mas$duree.ms., c(0.1, 0.9)))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; with 30 values ranging from 80.084553 to 197.994270. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

The model with regard of f0.

ai.mas.gam.f0 <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                              s(f0, bs="cr") +
                              ti(measurement.no, f0) +
                              s(measurement.no, by=ton.ord, bs="cr"),
                         data=ai.mas, method="ML")
summary.coefs(ai.mas.gam.f0)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   515.84      19.38  26.619  < 2e-16 ***
ton.ord2       98.96      21.39   4.628 4.21e-06 ***
ton.ord3      133.59      22.60   5.912 4.69e-09 ***
ton.ord4       99.55      19.87   5.009 6.49e-07 ***

Approximate significance of smooth terms:
                             edf Ref.df     F  p-value    
s(measurement.no)          5.043  6.028 3.347 0.002781 ** 
s(f0)                      2.675  3.219 6.283 0.000272 ***
ti(measurement.no,f0)      3.877  4.994 2.958 0.011798 *  
s(measurement.no):ton.ord2 3.114  3.839 7.162 2.42e-05 ***
s(measurement.no):ton.ord3 2.262  2.803 6.325 0.000460 ***
s(measurement.no):ton.ord4 4.213  5.118 8.474  < 2e-16 ***

The plot of such model.

plot_smooth(ai.mas.gam.f0, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.gam.f0, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.gam.f0, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.gam.f0, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.gam.f0, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.mas.gam.f0, view=c("measurement.no","f0"),
        ylim=quantile(ai.mas$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 100.125696 to 212.400605. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

extra models

 # random intercepts only
ai.mas.gam.int <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                             s(f0, bs="cr") +
                             ti(measurement.no, f0) +
                             s(measurement.no, by=ton.ord, bs="cr") +
                             s(numero, bs="re"),
                         data=ai.mas, method="fREML")
summary.coefs(ai.mas.gam.int)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   456.59      28.69  15.914  < 2e-16 ***
ton.ord2      102.72      21.32   4.817 1.69e-06 ***
ton.ord3      134.32      22.50   5.971 3.32e-09 ***
ton.ord4      106.18      19.91   5.333 1.20e-07 ***

Approximate significance of smooth terms:
                              edf Ref.df     F  p-value    
s(measurement.no)          5.1635  6.149 3.407 0.002221 ** 
s(f0)                      2.7581  3.306 6.210 0.000251 ***
ti(measurement.no,f0)      4.2159  5.440 2.916 0.011193 *  
s(measurement.no):ton.ord2 3.2824  4.041 7.045  1.4e-05 ***
s(measurement.no):ton.ord3 2.5371  3.148 6.155 0.000312 ***
s(measurement.no):ton.ord4 4.3255  5.243 8.514  < 2e-16 ***
s(numero)                  0.8844  1.000 7.653 0.003254 ** 
plot_smooth(ai.mas.gam.int, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.mas.gam.int, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.mas.gam.int, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.mas.gam.int, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.mas.gam.int, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 

fvisgam(ai.mas.gam.int, view=c("measurement.no","f0"),
        ylim=quantile(ai.mas$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 100.125696 to 212.400605. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

# random intercepts + slopes
ai.mas.gam.slope <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                            s(f0, bs="cr") +
                            ti(measurement.no, f0) +
                            s(measurement.no, by=ton.ord, bs="cr") +
                            s(numero, bs="re") +
                            s(numero, measurement.no, bs="re"),
                        data=ai.mas, method="fREML")
summary.coefs(ai.mas.gam.slope)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   455.37      26.73  17.034  < 2e-16 ***
ton.ord2      103.53      21.30   4.861 1.37e-06 ***
ton.ord3      134.92      22.47   6.005 2.71e-09 ***
ton.ord4      106.34      19.85   5.356 1.06e-07 ***

Approximate significance of smooth terms:
                                 edf Ref.df      F  p-value    
s(measurement.no)          5.1531792  6.138  4.177 0.000328 ***
s(f0)                      2.7569210  3.305  6.089 0.000298 ***
ti(measurement.no,f0)      4.1973202  5.423  2.853 0.012838 *  
s(measurement.no):ton.ord2 3.2594077  4.013  6.791 2.16e-05 ***
s(measurement.no):ton.ord3 2.5316088  3.141  6.168 0.000308 ***
s(measurement.no):ton.ord4 4.3419115  5.262  8.353  < 2e-16 ***
s(numero)                  0.0002281  1.000  0.000 0.606058    
s(numero,measurement.no)   0.9128615  1.000 10.485 0.000716 ***
plot_smooth(ai.mas.gam.slope, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.mas.gam.slope, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.mas.gam.slope, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.mas.gam.slope, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.mas.gam.slope, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 

fvisgam(ai.mas.gam.slope, view=c("measurement.no","f0"),
        ylim=quantile(ai.mas$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 100.125696 to 212.400605. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

plot_smooth(ai.mas.gam.slope, view="measurement.no", plot_all="ton.ord",
            rug=F, rm.ranef=T)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 137.402261031236. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 

#plot_diff(ai.mas.gam.slope, view="measurement.no",
          #comp=list(ton.ord = c("2","4")), rm.ranef=T)
#ai.mas.gam.smooth <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
#                           s(f0, bs="cr") +
#                           ti(measurement.no, f0) +
#                           s(measurement.no, by=ton.ord, bs="cr") +
#                           s(measurement.no, numero, bs="fs", xt="cr", m=1, k=5),
#                         data=ai.mas, method="fREML")
#summary.coefs(ai.mas.gam.smooth)
ai.mas$start.event <- ai.mas$measurement.no==0

r1 <- start_value_rho(ai.mas.gam.f0)

ai.mas.gam.AR <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                            s(f0, bs="cr") +
                            ti(measurement.no, f0) +
                            s(measurement.no, by=ton.ord, bs="cr"),
                       data=ai.mas, method="fREML",
                       rho=r1, AR.start=ai.mas$start.event)
summary.coefs(ai.mas.gam.AR)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   528.66      28.03  18.858  < 2e-16 ***
ton.ord2       91.67      30.74   2.982 0.002937 ** 
ton.ord3      115.66      32.36   3.574 0.000369 ***
ton.ord4       85.10      28.73   2.961 0.003137 ** 

Approximate significance of smooth terms:
                             edf Ref.df     F  p-value    
s(measurement.no)          6.036  7.043 3.644 0.000664 ***
s(f0)                      1.878  2.303 2.973 0.056214 .  
ti(measurement.no,f0)      4.238  5.488 2.497 0.025727 *  
s(measurement.no):ton.ord2 3.946  4.932 6.458 9.21e-06 ***
s(measurement.no):ton.ord3 3.172  4.024 4.928 0.000613 ***
s(measurement.no):ton.ord4 5.015  6.080 7.806  < 2e-16 ***
plot_smooth(ai.mas.gam.AR, view="measurement.no", plot_all="ton.ord",
            rug=F, rm.ranef=T)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 137.402261031236. 
    * NOTE : No random effects in the model to cancel.
 

plot_diff(ai.mas.gam.AR, view="measurement.no",
          comp=list(ton.ord = c("2","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 137.402261031236. 

measurement.no window(s) of significant difference(s):
    0.000000 - 1.515152

plot_smooth(ai.mas.gam.AR, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.gam.AR, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.gam.AR, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.gam.AR, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.gam.AR, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.mas.gam.AR, view=c("measurement.no","f0"),
        ylim=quantile(ai.mas$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 100.125696 to 212.400605. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

Central portion

We now focus on the central portion of the diphthongs, which means the portions without the inluence of the consonant contexts.

ai.central<-droplevels(subset(ai,measurement.no>=2))
ai.central<-droplevels(subset(ai.central,measurement.no<=8))

ai.central.mas <- droplevels(subset(ai.central,sexe=="M"))
ai.central.fem <- droplevels(subset(ai.central,sexe=="F"))
ai.central.mas$ton.ord <- as.ordered(ai.central.mas$ton)
contrasts(ai.central.mas$ton.ord) <- "contr.treatment"
ai.central.mas.gam.diff <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                        s(measurement.no, by=ton.ord, bs="cr",k=6),
                      data=ai.central.mas, method="ML")
summary.coefs(ai.central.mas.gam.diff)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   472.08      19.51  24.201  < 2e-16 ***
ton.ord2      171.54      20.96   8.184 1.28e-15 ***
ton.ord3      225.45      21.68  10.399  < 2e-16 ***
ton.ord4      187.63      20.19   9.292  < 2e-16 ***

Approximate significance of smooth terms:
                             edf Ref.df     F  p-value    
s(measurement.no)          2.404  2.924 9.433 1.01e-05 ***
s(measurement.no):ton.ord2 1.002  1.004 0.147   0.7039    
s(measurement.no):ton.ord3 1.002  1.005 1.309   0.2530    
s(measurement.no):ton.ord4 2.529  3.067 2.551   0.0533 .  
plot_smooth(ai.central.mas.gam.diff, view="measurement.no",
            plot_all="ton.ord", rug=F)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * NOTE : No random effects in the model to cancel.
 

plot_diff(ai.central.mas.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("1","2")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    2.000000 - 8.000000

plot_diff(ai.central.mas.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","3")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    2.848485 - 8.000000

plot_diff(ai.central.mas.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("3","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    2.000000 - 3.030303
    5.818182 - 8.000000

ai.central.mas.gam.dur <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                              s(duree.ms., bs="cr",k=6) +
                              ti(measurement.no, duree.ms.,k=6) +
                              s(measurement.no, by=ton.ord, bs="cr",k=6),
                         data=ai.central.mas, method="ML")
summary.coefs(ai.central.mas.gam.dur)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   483.05      19.43  24.864  < 2e-16 ***
ton.ord2      153.92      21.26   7.239 1.19e-12 ***
ton.ord3      225.56      21.26  10.609  < 2e-16 ***
ton.ord4      175.66      20.20   8.697  < 2e-16 ***

Approximate significance of smooth terms:
                               edf Ref.df      F  p-value    
s(measurement.no)            2.393  2.910 10.314 3.87e-06 ***
s(duree.ms.)                 4.484  4.852  4.597 0.000297 ***
ti(measurement.no,duree.ms.) 1.236  1.431  5.669 0.006689 ** 
s(measurement.no):ton.ord2   1.000  1.000  0.094 0.759550    
s(measurement.no):ton.ord3   1.000  1.001  1.487 0.223105    
s(measurement.no):ton.ord4   2.587  3.131  2.965 0.029587 *  
plot_smooth(ai.central.mas.gam.dur, view="measurement.no", cond=list(duree.ms.=170),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 170. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.mas.gam.dur, view="measurement.no", cond=list(duree.ms.=80),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 80. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.central.mas.gam.dur, view=c("measurement.no","duree.ms."),
        ylim=quantile(ai.central.mas$duree.ms., c(0.1, 0.9)))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; with 30 values ranging from 80.084553 to 197.994270. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

ai.central.mas.gam.f0 <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                              s(f0, bs="cr",k=6) +
                              ti(measurement.no, f0,k=6) +
                              s(measurement.no, by=ton.ord, bs="cr",k=6),
                         data=ai.central.mas, method="ML")
summary.coefs(ai.central.mas.gam.f0)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   480.55      18.43  26.068  < 2e-16 ***
ton.ord2      159.40      20.21   7.886  1.3e-14 ***
ton.ord3      182.35      21.24   8.583  < 2e-16 ***
ton.ord4      178.19      18.85   9.455  < 2e-16 ***

Approximate significance of smooth terms:
                             edf Ref.df     F  p-value    
s(measurement.no)          2.449  2.975 7.785  5.8e-05 ***
s(f0)                      2.888  3.362 5.997 0.000297 ***
ti(measurement.no,f0)      1.005  1.010 6.139 0.013357 *  
s(measurement.no):ton.ord2 1.000  1.000 0.233 0.629530    
s(measurement.no):ton.ord3 1.000  1.001 0.006 0.938828    
s(measurement.no):ton.ord4 2.698  3.256 2.878 0.031657 *  
plot_smooth(ai.central.mas.gam.f0, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.mas.gam.f0, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.mas.gam.f0, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.mas.gam.f0, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.mas.gam.f0, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.central.mas.gam.f0, view=c("measurement.no","f0"),
        ylim=quantile(ai.central.mas$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; with 30 values ranging from 99.155553 to 204.798228. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

F2

Basic models

Now we look at the trajectories of f2 in different tones with regard of the sexes and the durations.

ggplot(ai.mas, aes(x=measurement.no, y=f2, group=numero,
                     alpha=duree.ms.)) +
  facet_grid(~ton) + geom_line()

Then we fit the same model with a basic smooth of tone 1 and difference smooths.

ai.mas.f2.gam.diff <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr") +
                        s(measurement.no, by=ton.ord, bs="cr"),
                      data=ai.mas, method="ML")
summary.coefs(ai.mas.f2.gam.diff)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1808.78      25.76  70.213  < 2e-16 ***
ton.ord2     -190.78      27.71  -6.885 9.73e-12 ***
ton.ord3     -182.21      28.63  -6.364 2.89e-10 ***
ton.ord4     -157.18      26.70  -5.887 5.22e-09 ***

Approximate significance of smooth terms:
                             edf Ref.df     F  p-value    
s(measurement.no)          3.783  4.654 6.929 7.58e-06 ***
s(measurement.no):ton.ord2 1.000  1.001 0.783    0.376    
s(measurement.no):ton.ord3 1.001  1.001 0.225    0.635    
s(measurement.no):ton.ord4 1.004  1.008 0.360    0.550    

Now the plots of f2 with different tones.

plot_smooth(ai.mas.f2.gam.diff, view="measurement.no",
            plot_all="ton.ord", rug=F)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 

plot_diff(ai.mas.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("1","2")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    0.000000 - 10.000000

plot_diff(ai.mas.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","3")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    0.000000 - 2.020202

plot_diff(ai.mas.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("3","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    5.252525 - 10.000000

The model that accounts for the influence of duree.ms. on the trajectories.

ai.mas.f2.gam.dur <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr") +
                              s(duree.ms., bs="cr") +
                              ti(measurement.no, duree.ms.) +
                              s(measurement.no, by=ton.ord, bs="cr"),
                         data=ai.mas, method="ML")
summary.coefs(ai.mas.f2.gam.dur)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1826.36      25.30  72.182  < 2e-16 ***
ton.ord2     -210.79      27.64  -7.627 5.22e-14 ***
ton.ord3     -190.56      27.77  -6.861 1.15e-11 ***
ton.ord4     -178.75      26.32  -6.793 1.81e-11 ***

Approximate significance of smooth terms:
                               edf Ref.df      F  p-value    
s(measurement.no)            3.893  4.783  8.213 6.26e-07 ***
s(duree.ms.)                 3.903  4.707  5.118 0.000252 ***
ti(measurement.no,duree.ms.) 2.869  4.012 12.552  < 2e-16 ***
s(measurement.no):ton.ord2   1.001  1.002  1.332 0.248618    
s(measurement.no):ton.ord3   1.001  1.003  0.351 0.553691    
s(measurement.no):ton.ord4   1.001  1.003  0.038 0.847241    

The plots with regard the durations.

plot_smooth(ai.mas.f2.gam.dur, view="measurement.no", cond=list(duree.ms.=170),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 170. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.f2.gam.dur, view="measurement.no", cond=list(duree.ms.=80),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 80. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.mas.f2.gam.dur, view=c("measurement.no","duree.ms."),
        ylim=quantile(ai.mas$duree.ms., c(0.1, 0.9)))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; with 30 values ranging from 80.084553 to 197.994270. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

ai.mas.f2.gam.f0 <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr") +
                              s(f0, bs="cr") +
                              ti(measurement.no, f0) +
                              s(measurement.no, by=ton.ord, bs="cr"),
                         data=ai.mas, method="ML")
summary.coefs(ai.mas.f2.gam.f0)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1809.15      24.68  73.316  < 2e-16 ***
ton.ord2     -187.20      27.28  -6.862 1.21e-11 ***
ton.ord3     -201.12      28.74  -6.999 4.80e-12 ***
ton.ord4     -156.85      25.33  -6.191 8.79e-10 ***

Approximate significance of smooth terms:
                             edf Ref.df     F  p-value    
s(measurement.no)          4.100  5.036 9.733  < 2e-16 ***
s(f0)                      5.833  6.673 5.023 2.82e-05 ***
ti(measurement.no,f0)      2.307  2.805 2.708   0.0422 *  
s(measurement.no):ton.ord2 1.001  1.002 0.005   0.9472    
s(measurement.no):ton.ord3 1.001  1.001 0.034   0.8553    
s(measurement.no):ton.ord4 1.004  1.008 0.011   0.9373    
plot_smooth(ai.mas.f2.gam.f0, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.f2.gam.f0, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.f2.gam.f0, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.f2.gam.f0, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.mas.f2.gam.f0, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.mas.f2.gam.f0, view=c("measurement.no","f0"),
        ylim=quantile(ai.mas$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 100.125696 to 212.400605. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

extra models

 # random intercepts only
ai.mas.gam.f2.int <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr") +
                             s(f0, bs="cr") +
                             ti(measurement.no, f0) +
                             s(measurement.no, by=ton.ord, bs="cr") +
                             s(numero, bs="re"),
                         data=ai.mas, method="fREML")
summary.coefs(ai.mas.gam.f2.int)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1809.17      24.68  73.315  < 2e-16 ***
ton.ord2     -187.22      27.28  -6.863 1.20e-11 ***
ton.ord3     -201.16      28.74  -7.000 4.76e-12 ***
ton.ord4     -156.88      25.33  -6.192 8.74e-10 ***

Approximate significance of smooth terms:
                                 edf Ref.df     F  p-value    
s(measurement.no)          4.127e+00  5.067 9.697  < 2e-16 ***
s(f0)                      5.824e+00  6.663 5.023 2.86e-05 ***
ti(measurement.no,f0)      2.327e+00  2.827 2.705   0.0422 *  
s(measurement.no):ton.ord2 1.000e+00  1.000 0.005   0.9413    
s(measurement.no):ton.ord3 1.000e+00  1.000 0.034   0.8542    
s(measurement.no):ton.ord4 1.000e+00  1.000 0.011   0.9171    
s(numero)                  2.024e-05  1.000 0.000   0.6922    
plot_smooth(ai.mas.gam.f2.int, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.mas.gam.f2.int, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.mas.gam.f2.int, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.mas.gam.f2.int, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.mas.gam.f2.int, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 

fvisgam(ai.mas.gam.f2.int, view=c("measurement.no","f0"),
        ylim=quantile(ai.mas$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 100.125696 to 212.400605. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

# random intercepts + slopes
ai.mas.gam.f2.slope <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr") +
                            s(f0, bs="cr") +
                            ti(measurement.no, f0) +
                            s(measurement.no, by=ton.ord, bs="cr") +
                            s(numero, bs="re") +
                            s(numero, measurement.no, bs="re"),
                        data=ai.mas, method="fREML")
summary.coefs(ai.mas.gam.f2.slope)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1783.01      31.63  56.364  < 2e-16 ***
ton.ord2     -185.70      27.28  -6.806 1.75e-11 ***
ton.ord3     -200.83      28.72  -6.994 4.98e-12 ***
ton.ord4     -154.22      25.39  -6.073 1.80e-09 ***

Approximate significance of smooth terms:
                                 edf Ref.df     F  p-value    
s(measurement.no)          4.124e+00  5.064 7.800 4.40e-07 ***
s(f0)                      5.768e+00  6.604 4.719 6.49e-05 ***
ti(measurement.no,f0)      2.322e+00  2.822 2.658   0.0451 *  
s(measurement.no):ton.ord2 1.000e+00  1.000 0.022   0.8812    
s(measurement.no):ton.ord3 1.000e+00  1.000 0.024   0.8774    
s(measurement.no):ton.ord4 1.000e+00  1.001 0.033   0.8568    
s(numero)                  3.609e-05  1.000 0.000   0.4983    
s(numero,measurement.no)   6.351e-01  1.000 1.741   0.0975 .  
plot_smooth(ai.mas.gam.f2.slope, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.mas.gam.f2.slope, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.mas.gam.f2.slope, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.mas.gam.f2.slope, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.mas.gam.f2.slope, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 

fvisgam(ai.mas.gam.f2.slope, view=c("measurement.no","f0"),
        ylim=quantile(ai.mas$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 100.125696 to 212.400605. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

plot_smooth(ai.mas.gam.f2.slope, view="measurement.no", plot_all="ton.ord",
            rug=F, rm.ranef=T)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 137.402261031236. 
    * numero : numeric predictor; set to the value(s): 164. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 

#plot_diff(ai.mas.gam.slope, view="measurement.no",
          #comp=list(ton.ord = c("2","4")), rm.ranef=T)
#ai.mas.gam.f2.smooth <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
#                           s(f0, bs="cr") +
#                           ti(measurement.no, f0) +
#                           s(measurement.no, by=ton.ord, bs="cr") +
#                           s(measurement.no, numero, bs="fs", xt="cr", m=1, k=5),
#                         data=ai.mas, method="fREML")
#summary.coefs(ai.mas.gam.f2.smooth)

Central portion

The central portion:

ai.central.mas.f2.gam.diff <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                        s(measurement.no, by=ton.ord, bs="cr",k=6),
                      data=ai.central.mas, method="ML")
summary.coefs(ai.central.mas.f2.gam.diff)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1797.78      28.10  63.974  < 2e-16 ***
ton.ord2     -169.65      30.20  -5.618 2.77e-08 ***
ton.ord3     -154.65      31.23  -4.952 9.20e-07 ***
ton.ord4     -136.24      29.09  -4.683 3.38e-06 ***

Approximate significance of smooth terms:
                             edf Ref.df     F p-value   
s(measurement.no)          1.005  1.011 7.229 0.00732 **
s(measurement.no):ton.ord2 1.001  1.002 0.268 0.60543   
s(measurement.no):ton.ord3 1.001  1.002 0.035 0.85460   
s(measurement.no):ton.ord4 1.001  1.003 0.595 0.44147   
plot_smooth(ai.central.mas.f2.gam.diff, view="measurement.no",
            plot_all="ton.ord", rug=F)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * NOTE : No random effects in the model to cancel.
 

plot_diff(ai.central.mas.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("1","2")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    2.000000 - 8.000000

plot_diff(ai.central.mas.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","3")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

Difference is not significant.

plot_diff(ai.central.mas.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("3","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    6.242424 - 8.000000

plot_diff(ai.central.mas.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    3.939394 - 7.454545

ai.central.mas.f2.gam.dur <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                              s(duree.ms., bs="cr",k=6) +
                              ti(measurement.no, duree.ms.,k=6) +
                              s(measurement.no, by=ton.ord, bs="cr",k=6),
                         data=ai.central.mas, method="ML")
summary.coefs(ai.central.mas.f2.gam.dur)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1809.11      27.47  65.867  < 2e-16 ***
ton.ord2     -178.42      29.78  -5.992 3.30e-09 ***
ton.ord3     -158.81      30.29  -5.243 2.09e-07 ***
ton.ord4     -152.09      28.53  -5.331 1.32e-07 ***

Approximate significance of smooth terms:
                               edf Ref.df     F  p-value    
s(measurement.no)            1.106  1.204 6.368  0.01168 *  
s(duree.ms.)                 2.613  3.155 4.432  0.00315 ** 
ti(measurement.no,duree.ms.) 3.274  4.240 7.847 2.48e-06 ***
s(measurement.no):ton.ord2   1.001  1.002 1.433  0.23173    
s(measurement.no):ton.ord3   1.001  1.002 0.023  0.88142    
s(measurement.no):ton.ord4   1.002  1.003 0.342  0.56017    
plot_smooth(ai.central.mas.f2.gam.dur, view="measurement.no", cond=list(duree.ms.=170),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 170. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.mas.f2.gam.dur, view="measurement.no", cond=list(duree.ms.=80),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 80. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.central.mas.f2.gam.dur, view=c("measurement.no","duree.ms."),
        ylim=quantile(ai.central.mas$duree.ms., c(0.1, 0.9)))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; with 30 values ranging from 80.084553 to 197.994270. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

ai.central.mas.f2.gam.f0 <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                              s(f0, bs="cr",k=6) +
                              ti(measurement.no, f0,k=6) +
                              s(measurement.no, by=ton.ord, bs="cr",k=6),
                         data=ai.central.mas, method="ML")
summary.coefs(ai.central.mas.f2.gam.f0)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1808.72      25.82  70.057  < 2e-16 ***
ton.ord2     -183.71      28.33  -6.485 1.74e-10 ***
ton.ord3     -198.13      29.76  -6.658 5.86e-11 ***
ton.ord4     -147.99      26.51  -5.582 3.48e-08 ***

Approximate significance of smooth terms:
                             edf Ref.df     F  p-value    
s(measurement.no)          1.001  1.002 9.506  0.00212 ** 
s(f0)                      4.105  4.579 7.115 2.97e-06 ***
ti(measurement.no,f0)      5.049  5.936 5.348 2.37e-05 ***
s(measurement.no):ton.ord2 1.001  1.001 0.421  0.51700    
s(measurement.no):ton.ord3 1.001  1.001 0.465  0.49561    
s(measurement.no):ton.ord4 1.001  1.001 0.610  0.43499    
plot_smooth(ai.central.mas.f2.gam.f0, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.mas.f2.gam.f0, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.mas.f2.gam.f0, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.mas.f2.gam.f0, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.mas.f2.gam.f0, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.central.mas.f2.gam.f0, view=c("measurement.no","f0"),
        ylim=quantile(ai.central.mas$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; with 30 values ranging from 99.155553 to 204.798228. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

Féminin

F1

Basic models

We now switch to the data of feminin subjects.

ggplot(ai.fem, aes(x=measurement.no, y=f1, group=numero,
                     alpha=duree.ms.)) +
  facet_grid(~ton) + geom_line()

The first model with a basic smooth of tone 1 and difference smooths.

ai.fem$ton.ord <- as.ordered(ai.fem$ton)
contrasts(ai.fem$ton.ord) <- "contr.treatment"
ai.fem.gam.diff <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                        s(measurement.no, by=ton.ord, bs="cr"),
                      data=ai.fem, method="ML")
summary.coefs(ai.fem.gam.diff)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  727.300     10.502  69.251  < 2e-16 ***
ton.ord2      41.824     12.745   3.282  0.00106 ** 
ton.ord3       9.285     13.129   0.707  0.47957    
ton.ord4      -4.129     11.138  -0.371  0.71090    

Approximate significance of smooth terms:
                             edf Ref.df      F p-value    
s(measurement.no)          4.990  6.014 22.139 < 2e-16 ***
s(measurement.no):ton.ord2 1.976  2.459  3.589 0.02225 *  
s(measurement.no):ton.ord3 1.004  1.008  4.710 0.03005 *  
s(measurement.no):ton.ord4 2.916  3.598  4.183 0.00373 ** 

Then the plots of predictions and difference smooth.

plot_smooth(ai.fem.gam.diff, view="measurement.no",
            plot_all="ton.ord", rug=F)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 

plot_diff(ai.fem.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("1","2")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    0.000000 - 4.343434

plot_diff(ai.fem.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","3")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    0.000000 - 2.323232
    7.777778 - 10.000000

plot_diff(ai.fem.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("3","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    0.000000 - 2.828283
    6.161616 - 7.676768

The model that accounts for the influence of duree.ms. on the trajectories.

ai.fem.gam.dur <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                              s(duree.ms., bs="cr") +
                              ti(measurement.no, duree.ms.) +
                              s(measurement.no, by=ton.ord, bs="cr"),
                         data=ai.fem, method="ML")
summary.coefs(ai.fem.gam.dur)
Parametric coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept) 725.48603   10.51394  69.002  < 2e-16 ***
ton.ord2     38.51010   12.39140   3.108  0.00193 ** 
ton.ord3      9.42465   13.15220   0.717  0.47377    
ton.ord4      0.02272   11.37780   0.002  0.99841    

Approximate significance of smooth terms:
                               edf Ref.df      F p-value    
s(measurement.no)            5.275  6.330 25.533 < 2e-16 ***
s(duree.ms.)                 7.132  8.041  6.159 < 2e-16 ***
ti(measurement.no,duree.ms.) 8.571 10.747  5.436 < 2e-16 ***
s(measurement.no):ton.ord2   2.039  2.534  3.642 0.01899 *  
s(measurement.no):ton.ord3   1.007  1.012 10.009 0.00158 ** 
s(measurement.no):ton.ord4   2.434  3.015  2.159 0.09079 .  

The plots with regard the durations.

plot_smooth(ai.fem.gam.dur, view="measurement.no", cond=list(duree.ms.=170),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 170. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.gam.dur, view="measurement.no", cond=list(duree.ms.=80),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 80. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.fem.gam.dur, view=c("measurement.no","duree.ms."),
        ylim=quantile(ai.fem$duree.ms., c(0.1, 0.9)))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; with 30 values ranging from 89.970028 to 186.666330. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

The model with regard of f0.

ai.fem.gam.f0 <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                              s(f0, bs="cr") +
                              ti(measurement.no, f0) +
                              s(measurement.no, by=ton.ord, bs="cr"),
                         data=ai.fem, method="ML")
summary.coefs(ai.fem.gam.f0)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  726.023     10.603  68.474   <2e-16 ***
ton.ord2      36.953     14.222   2.598   0.0095 ** 
ton.ord3      15.256     14.126   1.080   0.2804    
ton.ord4      -2.092     11.020  -0.190   0.8494    

Approximate significance of smooth terms:
                             edf Ref.df      F  p-value    
s(measurement.no)          5.092  6.142 32.725  < 2e-16 ***
s(f0)                      1.000  1.000  1.679 0.195397    
ti(measurement.no,f0)      2.285  2.770  5.741 0.000985 ***
s(measurement.no):ton.ord2 1.000  1.001  0.466 0.495028    
s(measurement.no):ton.ord3 1.000  1.001  0.245 0.620400    
s(measurement.no):ton.ord4 2.564  3.184  3.425 0.015002 *  

The plot of such model.

plot_smooth(ai.fem.gam.f0, view="measurement.no", cond=list(f0=180),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.gam.f0, view="measurement.no", cond=list(f0=200),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.gam.f0, view="measurement.no", cond=list(f0=220),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 220. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.gam.f0, view="measurement.no", cond=list(f0=240),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 240. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.gam.f0, view="measurement.no", cond=list(f0=260),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 260. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.fem.gam.f0, view=c("measurement.no","f0"),
        ylim=quantile(ai.fem$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 159.611858 to 275.883293. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

extra models

 # random intercepts only
ai.fem.gam.int <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                             s(f0, bs="cr") +
                             ti(measurement.no, f0) +
                             s(measurement.no, by=ton.ord, bs="cr") +
                             s(numero, bs="re"),
                         data=ai.fem, method="fREML")
summary.coefs(ai.fem.gam.int)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  748.285     11.493  65.107   <2e-16 ***
ton.ord2      35.242     14.163   2.488    0.013 *  
ton.ord3      21.055     14.126   1.490    0.136    
ton.ord4       1.546     11.010   0.140    0.888    

Approximate significance of smooth terms:
                              edf Ref.df      F  p-value    
s(measurement.no)          5.1331  6.184 32.528  < 2e-16 ***
s(f0)                      1.0000  1.000  1.098  0.29484    
ti(measurement.no,f0)      3.5799  4.896  3.511  0.00416 ** 
s(measurement.no):ton.ord2 1.0001  1.000  0.150  0.69866    
s(measurement.no):ton.ord3 1.0003  1.001  0.124  0.72537    
s(measurement.no):ton.ord4 2.6626  3.295  3.625  0.01065 *  
s(numero)                  0.9609  1.000 24.572 7.72e-07 ***
plot_smooth(ai.fem.gam.int, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.fem.gam.int, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.fem.gam.int, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.fem.gam.int, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
plot_smooth(ai.fem.gam.int, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 

fvisgam(ai.fem.gam.int, view=c("measurement.no","f0"),
        ylim=quantile(ai.mas$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 100.125696 to 212.400605. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero)
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

# random intercepts + slopes
ai.fem.gam.slope <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                            s(f0, bs="cr") +
                            ti(measurement.no, f0) +
                            s(measurement.no, by=ton.ord, bs="cr") +
                            s(numero, bs="re") +
                            s(numero, measurement.no, bs="re"),
                        data=ai.fem, method="fREML")
summary.coefs(ai.fem.gam.slope)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  747.286     11.407  65.514   <2e-16 ***
ton.ord2      36.487     14.158   2.577   0.0101 *  
ton.ord3      21.379     14.114   1.515   0.1301    
ton.ord4       1.958     11.003   0.178   0.8588    

Approximate significance of smooth terms:
                              edf Ref.df      F p-value    
s(measurement.no)          5.1283  6.178 30.085 < 2e-16 ***
s(f0)                      1.0001  1.000  1.323 0.25034    
ti(measurement.no,f0)      3.4752  4.757  3.598 0.00400 ** 
s(measurement.no):ton.ord2 1.0002  1.000  0.156 0.69325    
s(measurement.no):ton.ord3 1.0003  1.001  0.034 0.85413    
s(measurement.no):ton.ord4 2.6666  3.300  3.757 0.00877 ** 
s(numero)                  0.6759  1.000  5.927 0.07910 .  
s(numero,measurement.no)   0.8148  1.000 12.630 0.02023 *  
plot_smooth(ai.fem.gam.slope, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.fem.gam.slope, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.fem.gam.slope, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.fem.gam.slope, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
plot_smooth(ai.fem.gam.slope, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 

fvisgam(ai.fem.gam.slope, view=c("measurement.no","f0"),
        ylim=quantile(ai.fem$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 159.611858 to 275.883293. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

plot_smooth(ai.fem.gam.slope, view="measurement.no", plot_all="ton.ord",
            rug=F, rm.ranef=T)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 203.561992329367. 
    * numero : numeric predictor; set to the value(s): 57. (Might be canceled as random effect, check below.) 
    * NOTE : The following random effects columns are canceled: s(numero),s(numero,measurement.no)
 

#plot_diff(ai.mas.gam.slope, view="measurement.no",
          #comp=list(ton.ord = c("2","4")), rm.ranef=T)
#ai.fem.gam.smooth <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
#                           s(f0, bs="cr") +
#                           ti(measurement.no, f0) +
#                           s(measurement.no, by=ton.ord, bs="cr") +
#                           s(measurement.no, numero, bs="fs", xt="cr", m=1, k=5),
#                         data=ai.fem, method="fREML")
#summary.coefs(ai.fem.gam.smooth)
ai.fem$start.event <- ai.fem$measurement.no==0

r1 <- start_value_rho(ai.fem.gam.f0)

ai.fem.gam.AR <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr") +
                            s(f0, bs="cr") +
                            ti(measurement.no, f0) +
                            s(measurement.no, by=ton.ord, bs="cr"),
                       data=ai.fem, method="fREML",
                       rho=r1, AR.start=ai.fem$start.event)
summary.coefs(ai.fem.gam.AR)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  730.847     17.036  42.901   <2e-16 ***
ton.ord2      44.139     22.273   1.982   0.0478 *  
ton.ord3       8.903     22.447   0.397   0.6917    
ton.ord4      -4.354     17.857  -0.244   0.8074    

Approximate significance of smooth terms:
                             edf Ref.df      F  p-value    
s(measurement.no)          6.289  7.490 24.971  < 2e-16 ***
s(f0)                      1.000  1.000  0.669 0.413682    
ti(measurement.no,f0)      4.329  5.818  4.314 0.000372 ***
s(measurement.no):ton.ord2 1.000  1.000  0.805 0.369761    
s(measurement.no):ton.ord3 1.000  1.001  0.385 0.535005    
s(measurement.no):ton.ord4 3.102  3.972  3.223 0.013040 *  
plot_smooth(ai.fem.gam.AR, view="measurement.no", plot_all="ton.ord",
            rug=F, rm.ranef=T)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 203.561992329367. 
    * NOTE : No random effects in the model to cancel.
 

plot_diff(ai.fem.gam.AR, view="measurement.no",
          comp=list(ton.ord = c("2","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 203.561992329367. 

measurement.no window(s) of significant difference(s):
    0.000000 - 3.939394
    7.575758 - 10.000000

plot_smooth(ai.fem.gam.AR, view="measurement.no", cond=list(f0=100),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 100. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.gam.AR, view="measurement.no", cond=list(f0=120),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 120. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.gam.AR, view="measurement.no", cond=list(f0=140),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 140. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.gam.AR, view="measurement.no", cond=list(f0=180),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.gam.AR, view="measurement.no", cond=list(f0=200),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.fem.gam.AR, view=c("measurement.no","f0"),
        ylim=quantile(ai.fem$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 159.611858 to 275.883293. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

Central portion

We now focus on the central portion of the diphthongs, which means the portions without the inluence of the consonant contexts.

ai.central.fem$ton.ord <- as.ordered(ai.central.fem$ton)
contrasts(ai.central.fem$ton.ord) <- "contr.treatment"
ai.central.fem.gam.diff <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                        s(measurement.no, by=ton.ord, bs="cr",k=6),
                      data=ai.central.fem, method="ML")
summary.coefs(ai.central.fem.gam.diff)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  764.464     10.337  73.951   <2e-16 ***
ton.ord2      23.456     12.626   1.858   0.0636 .  
ton.ord3       1.278     13.036   0.098   0.9219    
ton.ord4       6.941     10.981   0.632   0.5275    

Approximate significance of smooth terms:
                             edf Ref.df     F  p-value    
s(measurement.no)          2.787  3.350 9.759 1.85e-06 ***
s(measurement.no):ton.ord2 1.002  1.005 3.192   0.0744 .  
s(measurement.no):ton.ord3 1.002  1.005 5.494   0.0192 *  
s(measurement.no):ton.ord4 2.339  2.843 2.021   0.1193    
plot_smooth(ai.central.fem.gam.diff, view="measurement.no",
            plot_all="ton.ord", rug=F)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * NOTE : No random effects in the model to cancel.
 

plot_diff(ai.central.fem.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("1","2")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    2.000000 - 4.848485

plot_diff(ai.central.fem.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","3")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    4.787879 - 7.090909

plot_diff(ai.central.fem.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("3","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    2.000000 - 2.969697
    5.151515 - 8.000000

ai.central.fem.gam.dur <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                              s(duree.ms., bs="cr",k=6) +
                              ti(measurement.no, duree.ms.,k=6) +
                              s(measurement.no, by=ton.ord, bs="cr",k=6),
                         data=ai.central.fem, method="ML")
summary.coefs(ai.central.fem.gam.dur)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  765.093     10.573  72.362   <2e-16 ***
ton.ord2      24.013     12.492   1.922    0.055 .  
ton.ord3      -2.690     13.290  -0.202    0.840    
ton.ord4       6.656     11.439   0.582    0.561    

Approximate significance of smooth terms:
                               edf Ref.df      F  p-value    
s(measurement.no)            2.800  3.363 10.238 9.86e-07 ***
s(duree.ms.)                 4.244  4.713  3.477   0.0354 *  
ti(measurement.no,duree.ms.) 2.227  2.802  2.612   0.0375 *  
s(measurement.no):ton.ord2   1.001  1.002  3.054   0.0809 .  
s(measurement.no):ton.ord3   1.001  1.002  5.522   0.0190 *  
s(measurement.no):ton.ord4   2.354  2.860  2.097   0.1080    
plot_smooth(ai.central.fem.gam.dur, view="measurement.no", cond=list(duree.ms.=170),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 170. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.fem.gam.dur, view="measurement.no", cond=list(duree.ms.=80),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 80. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.central.fem.gam.dur, view=c("measurement.no","duree.ms."),
        ylim=quantile(ai.central.fem$duree.ms., c(0.1, 0.9)))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; with 30 values ranging from 89.970028 to 186.666330. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

ai.central.fem.gam.f0 <- bam(f1 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                              s(f0, bs="cr",k=6) +
                              ti(measurement.no, f0,k=6) +
                              s(measurement.no, by=ton.ord, bs="cr",k=6),
                         data=ai.central.fem, method="ML")
summary.coefs(ai.central.fem.gam.f0)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   753.01      10.66  70.639   <2e-16 ***
ton.ord2       40.34      14.26   2.829   0.0048 ** 
ton.ord3       25.36      14.31   1.771   0.0769 .  
ton.ord4       14.76      11.07   1.333   0.1828    

Approximate significance of smooth terms:
                             edf Ref.df      F p-value    
s(measurement.no)          2.956  3.535 12.622 < 2e-16 ***
s(f0)                      1.000  1.001  9.090 0.00265 ** 
ti(measurement.no,f0)      1.003  1.006  7.019 0.00817 ** 
s(measurement.no):ton.ord2 1.001  1.002  1.025 0.31201    
s(measurement.no):ton.ord3 1.001  1.001  1.560 0.21208    
s(measurement.no):ton.ord4 2.117  2.590  1.603 0.18325    
plot_smooth(ai.central.fem.gam.f0, view="measurement.no", cond=list(f0=180),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.fem.gam.f0, view="measurement.no", cond=list(f0=200),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.fem.gam.f0, view="measurement.no", cond=list(f0=220),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 220. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.fem.gam.f0, view="measurement.no", cond=list(f0=240),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 240. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.fem.gam.f0, view="measurement.no", cond=list(f0=260),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 260. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.central.fem.gam.f0, view=c("measurement.no","f0"),
        ylim=quantile(ai.central.fem$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; with 30 values ranging from 159.333410 to 268.051028. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

F2

ggplot(ai.fem, aes(x=measurement.no, y=f2, group=numero,
                     alpha=duree.ms.)) +
  facet_grid(~ton) + geom_line()

Basic models

We fit the same model with a basic smooth of tone 1 and difference smooths.

ai.fem.f2.gam.diff <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr") +
                        s(measurement.no, by=ton.ord, bs="cr"),
                      data=ai.fem, method="ML")
summary.coefs(ai.fem.f2.gam.diff)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  2038.36      17.15 118.880  < 2e-16 ***
ton.ord2     -107.98      20.81  -5.189 2.49e-07 ***
ton.ord3      -88.98      21.43  -4.152 3.53e-05 ***
ton.ord4      -70.79      18.18  -3.893 0.000105 ***

Approximate significance of smooth terms:
                             edf Ref.df      F  p-value    
s(measurement.no)          4.280  5.234  3.945 0.001255 ** 
s(measurement.no):ton.ord2 1.002  1.005 22.811 2.65e-06 ***
s(measurement.no):ton.ord3 2.149  2.673  9.920 9.98e-06 ***
s(measurement.no):ton.ord4 1.003  1.005 11.113 0.000866 ***

Now the plots of f2 with different tones.

plot_smooth(ai.fem.f2.gam.diff, view="measurement.no",
            plot_all="ton.ord", rug=F)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * NOTE : No random effects in the model to cancel.
 

plot_diff(ai.fem.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("1","2")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    0.000000 - 6.666667

plot_diff(ai.fem.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","3")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    4.545455 - 5.959596

plot_diff(ai.fem.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("3","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 0.000000 to 10.000000. 

measurement.no window(s) of significant difference(s):
    0.000000 - 2.424242

The model that accounts for the influence of duree.ms. on the trajectories.

ai.fem.f2.gam.dur <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr") +
                              s(duree.ms., bs="cr") +
                              ti(measurement.no, duree.ms.) +
                              s(measurement.no, by=ton.ord, bs="cr"),
                         data=ai.fem, method="ML")
summary.coefs(ai.fem.f2.gam.dur)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  2038.81      17.36 117.410  < 2e-16 ***
ton.ord2     -102.76      20.46  -5.023 5.88e-07 ***
ton.ord3      -87.08      21.69  -4.014 6.35e-05 ***
ton.ord4      -73.67      18.78  -3.922 9.29e-05 ***

Approximate significance of smooth terms:
                               edf Ref.df      F  p-value    
s(measurement.no)            4.356  5.321  4.858 0.000157 ***
s(duree.ms.)                 6.537  7.514  5.600 1.96e-06 ***
ti(measurement.no,duree.ms.) 3.189  3.659  7.475 1.13e-05 ***
s(measurement.no):ton.ord2   1.002  1.005 21.541 3.84e-06 ***
s(measurement.no):ton.ord3   2.182  2.713  8.207 6.17e-05 ***
s(measurement.no):ton.ord4   1.004  1.007  4.444 0.034836 *  

The plots with regard the durations.

plot_smooth(ai.fem.f2.gam.dur, view="measurement.no", cond=list(duree.ms.=170),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 170. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.f2.gam.dur, view="measurement.no", cond=list(duree.ms.=80),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 80. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.fem.f2.gam.dur, view=c("measurement.no","duree.ms."),
        ylim=quantile(ai.fem$duree.ms., c(0.1, 0.9)))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * duree.ms. : numeric predictor; with 30 values ranging from 89.970028 to 186.666330. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

ai.fem.f2.gam.f0 <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr") +
                              s(f0, bs="cr") +
                              ti(measurement.no, f0) +
                              s(measurement.no, by=ton.ord, bs="cr"),
                         data=ai.fem, method="ML")
summary.coefs(ai.fem.f2.gam.f0)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  2006.20      17.59 114.025   <2e-16 ***
ton.ord2      -47.56      23.69  -2.008   0.0449 *  
ton.ord3      -39.15      23.59  -1.660   0.0972 .  
ton.ord4      -33.95      18.66  -1.819   0.0691 .  

Approximate significance of smooth terms:
                             edf Ref.df      F  p-value    
s(measurement.no)          3.765  4.647  3.339 0.006051 ** 
s(f0)                      4.465  5.325  9.702  < 2e-16 ***
ti(measurement.no,f0)      1.001  1.002  3.953 0.046912 *  
s(measurement.no):ton.ord2 1.000  1.001  7.075 0.007921 ** 
s(measurement.no):ton.ord3 1.878  2.345  4.999 0.004516 ** 
s(measurement.no):ton.ord4 1.001  1.002 14.369 0.000158 ***
plot_smooth(ai.fem.f2.gam.f0, view="measurement.no", cond=list(f0=180),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.f2.gam.f0, view="measurement.no", cond=list(f0=200),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.f2.gam.f0, view="measurement.no", cond=list(f0=220),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 220. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.f2.gam.f0, view="measurement.no", cond=list(f0=240),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 240. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.fem.f2.gam.f0, view="measurement.no", cond=list(f0=260),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; set to the value(s): 260. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.fem.f2.gam.f0, view=c("measurement.no","f0"),
        ylim=quantile(ai.fem$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 0.000000 to 10.000000. 
    * f0 : numeric predictor; with 30 values ranging from 159.611858 to 275.883293. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

Central portion

The central portion:

ai.central.fem.f2.gam.diff <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                        s(measurement.no, by=ton.ord, bs="cr",k=6),
                      data=ai.central.fem, method="ML")
summary.coefs(ai.central.fem.f2.gam.diff)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  2048.03      17.96 114.046  < 2e-16 ***
ton.ord2     -110.36      21.93  -5.032 6.06e-07 ***
ton.ord3      -68.99      22.65  -3.047  0.00239 ** 
ton.ord4      -74.75      19.08  -3.919 9.70e-05 ***

Approximate significance of smooth terms:
                             edf Ref.df     F p-value   
s(measurement.no)          1.354  1.610 3.247 0.03218 * 
s(measurement.no):ton.ord2 1.002  1.003 7.512 0.00623 **
s(measurement.no):ton.ord3 1.002  1.004 6.353 0.01188 * 
s(measurement.no):ton.ord4 1.108  1.194 1.388 0.20091   
plot_smooth(ai.central.fem.f2.gam.diff, view="measurement.no",
            plot_all="ton.ord", rug=F)
Summary:
    * ton.ord : factor; set to the value(s): 1, 2, 3, 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * NOTE : No random effects in the model to cancel.
 

plot_diff(ai.central.fem.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("1","2")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    2.000000 - 6.727273

plot_diff(ai.central.fem.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","3")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    3.757576 - 5.818182

plot_diff(ai.central.fem.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("3","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

Difference is not significant.

plot_diff(ai.central.fem.f2.gam.diff, view="measurement.no",
          comp=list(ton.ord=c("2","4")))
Summary:
    * measurement.no : numeric predictor; with 100 values ranging from 2.000000 to 8.000000. 

measurement.no window(s) of significant difference(s):
    2.000000 - 5.333333

ai.central.fem.f2.gam.dur <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                              s(duree.ms., bs="cr",k=6) +
                              ti(measurement.no, duree.ms.,k=6) +
                              s(measurement.no, by=ton.ord, bs="cr",k=6),
                         data=ai.central.fem, method="ML")
summary.coefs(ai.central.fem.f2.gam.dur)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  2057.82      18.18 113.168  < 2e-16 ***
ton.ord2     -114.28      21.48  -5.321 1.36e-07 ***
ton.ord3      -74.34      22.87  -3.251   0.0012 ** 
ton.ord4      -88.36      19.67  -4.491 8.18e-06 ***

Approximate significance of smooth terms:
                               edf Ref.df     F  p-value    
s(measurement.no)            1.226  1.395 6.156 0.005088 ** 
s(duree.ms.)                 4.351  4.781 5.615 0.000994 ***
ti(measurement.no,duree.ms.) 2.317  2.905 5.698 0.001249 ** 
s(measurement.no):ton.ord2   1.001  1.002 7.310 0.006986 ** 
s(measurement.no):ton.ord3   1.001  1.002 4.581 0.032602 *  
s(measurement.no):ton.ord4   1.276  1.479 0.171 0.687964    
plot_smooth(ai.central.fem.f2.gam.dur, view="measurement.no", cond=list(duree.ms.=170),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 170. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.fem.f2.gam.dur, view="measurement.no", cond=list(duree.ms.=80),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; set to the value(s): 80. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.central.fem.f2.gam.dur, view=c("measurement.no","duree.ms."),
        ylim=quantile(ai.central.fem$duree.ms., c(0.1, 0.9)))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * duree.ms. : numeric predictor; with 30 values ranging from 89.970028 to 186.666330. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

ai.central.fem.f2.gam.f0 <- bam(f2 ~ ton.ord + s(measurement.no, bs="cr",k=6) +
                              s(f0, bs="cr",k=6) +
                              ti(measurement.no, f0,k=6) +
                              s(measurement.no, by=ton.ord, bs="cr",k=6),
                         data=ai.central.fem, method="ML")
summary.coefs(ai.central.fem.f2.gam.f0)
Parametric coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  2010.59      18.67 107.680   <2e-16 ***
ton.ord2      -46.55      25.44  -1.830   0.0677 .  
ton.ord3      -24.49      25.01  -0.979   0.3278    
ton.ord4      -31.78      19.74  -1.610   0.1079    

Approximate significance of smooth terms:
                             edf Ref.df      F p-value    
s(measurement.no)          1.019  1.036  9.108 0.00263 ** 
s(f0)                      3.656  4.215 12.066 < 2e-16 ***
ti(measurement.no,f0)      2.960  3.539  4.413 0.00284 ** 
s(measurement.no):ton.ord2 1.001  1.001  2.724 0.09917 .  
s(measurement.no):ton.ord3 1.001  1.001  2.309 0.12896    
s(measurement.no):ton.ord4 1.158  1.296  1.005 0.41341    
plot_smooth(ai.central.fem.f2.gam.f0, view="measurement.no", cond=list(f0=180),
            rug=F, col="red")
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 180. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.fem.f2.gam.f0, view="measurement.no", cond=list(f0=200),
            rug=F, col="orange", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 200. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.fem.f2.gam.f0, view="measurement.no", cond=list(f0=220),
            rug=F, col="yellow", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 220. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.fem.f2.gam.f0, view="measurement.no", cond=list(f0=240),
            rug=F, col="green", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 240. 
    * NOTE : No random effects in the model to cancel.
 
plot_smooth(ai.central.fem.f2.gam.f0, view="measurement.no", cond=list(f0=260),
            rug=F, col="blue", add=T)
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; set to the value(s): 260. 
    * NOTE : No random effects in the model to cancel.
 

fvisgam(ai.central.fem.f2.gam.f0, view=c("measurement.no","f0"),
        ylim=quantile(ai.central.fem$f0, c(0.1, 0.9), na.rm=TRUE))
Summary:
    * ton.ord : factor; set to the value(s): 4. 
    * measurement.no : numeric predictor; with 30 values ranging from 2.000000 to 8.000000. 
    * f0 : numeric predictor; with 30 values ranging from 159.333410 to 268.051028. 
    * NOTE : No random effects in the model to cancel.
 
data length [31] is not a sub-multiple or multiple of the number of rows [30]

Predictions and vowel space

LS0tCnRpdGxlOiAnTm90ZWJvb2s6IE1vZMOpbGlzYXRpb24gR0FNTXMgZGUgbGEgZGlwaHRvbmd1ZSBkZXNjZW5kYW50ZSAvYWkvIGVuIG1hbmRhcmluCiAgc3RhbmRhcmQnCmF1dGhvcjogIkNoZW55dSBMSSIKb3V0cHV0OgogIGh0bWxfZG9jdW1lbnQ6CiAgICBkZl9wcmludDogcGFnZWQKLS0tCgpDZSBub3RlYm9vayBlc3QgdW5lIGFuYWx5c2UgYWNvdXN0aXF1ZSBkZXMgKipkaXBodG9uZ3VlcyBkZXNjZW5kYW50ZXMqKiBlbiAqKm1hbmRhcmluIHN0YW5kYXJkKiosIGVuIGFwcGxpcXVhbnQgbGEgbW9kw6lsaXNhdGlvbiAqKkdBTU1zKiogKEdlbmVyYXRlZCBBZGRpdGl2ZSBNaXhlZCBNb2RlbHMpLgoKYGBge3J9CiNpbnN0YWxsLnBhY2thZ2VzKCdybWFya2Rvd24nKQpgYGAKCmBgYHtyfQojIEltcG9ydGF0aW9uIGRlcyBlbWJhbGxhZ2VzIAojaW5zdGFsbC5wYWNrYWdlcygiaXRzYWR1ZyIpCmxpYnJhcnkobmxtZSkKbGlicmFyeShnZ3Bsb3QyKQpsaWJyYXJ5KG1nY3YpCmxpYnJhcnkoaXRzYWR1ZykKc291cmNlKCJnYW1tX2hhY2tzLnIiKQojaW5zdGFsbC5wYWNrYWdlcygidGlkeXZlcnNlIikKbGlicmFyeSh0aWR5dmVyc2UpCmBgYAoKQXByw6hzIGwnaW1wb3J0YXRpb24gZGVzIGVtYmFsbGFnZXMsIG5vdXMgbGlzb25zIGxlcyBiYXNlcyBkZSBkb25uw6llcyBlbiBmb3JtYXQgKi50c3YqLgoKYGBge3J9CiMgSW1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IG5hLnJtPVRSVUUpKQpgYGAKCiMjIyMgZXh0cmEgbW9kZWxzCgpgYGB7cn0KICMgcmFuZG9tIGludGVyY2VwdHMgb25seQphaS5tYXMuZ2FtLmludCA8LSBiYW0oZjEgfiB0b24ub3JkICsgcyhtZWFzdXJlbWVudC5ubywgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMoZjAsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjApICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBieT10b24ub3JkLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyhudW1lcm8sIGJzPSJyZSIpLAogICAgICAgICAgICAgICAgICAgICAgICAgZGF0YT1haS5tYXMsIG1ldGhvZD0iZlJFTUwiKQpzdW1tYXJ5LmNvZWZzKGFpLm1hcy5nYW0uaW50KQpgYGAKCmBgYHtyfQpwbG90X3Ntb290aChhaS5tYXMuZ2FtLmludCwgdmlldz0ibWVhc3VyZW1lbnQubm8iLCBjb25kPWxpc3QoZjA9MTAwKSwKICAgICAgICAgICAgcnVnPUYsIGNvbD0icmVkIikKcGxvdF9zbW9vdGgoYWkubWFzLmdhbS5pbnQsIHZpZXc9Im1lYXN1cmVtZW50Lm5vIiwgY29uZD1saXN0KGYwPTEyMCksCiAgICAgICAgICAgIHJ1Zz1GLCBjb2w9Im9yYW5nZSIsIGFkZD1UKQpwbG90X3Ntb290aChhaS5tYXMuZ2FtLmludCwgdmlldz0ibWVhc3VyZW1lbnQubm8iLCBjb25kPWxpc3QoZjA9MTQwKSwKICAgICAgICAgICAgcnVnPUYsIGNvbD0ieWVsbG93IiwgYWRkPVQpCnBsb3Rfc21vb3RoKGFpLm1hcy5nYW0uaW50LCB2aWV3PSJtZWFzdXJlbWVudC5ubyIsIGNvbmQ9bGlzdChmMD0xODApLAogICAgICAgICAgICBydWc9RiwgY29sPSJncmVlbiIsIGFkZD1UKQpwbG90X3Ntb290aChhaS5tYXMuZ2FtLmludCwgdmlldz0ibWVhc3VyZW1lbnQubm8iLCBjb25kPWxpc3QoZjA9MjAwKSwKICAgICAgICAgICAgcnVnPUYsIGNvbD0iYmx1ZSIsIGFkZD1UKQpmdmlzZ2FtKGFpLm1hcy5nYW0uaW50LCB2aWV3PWMoIm1lYXN1cmVtZW50Lm5vIiwiZjAiKSwKICAgICAgICB5bGltPXF1YW50aWxlKGFpLm1hcyRmMCwgYygwLjEsIDAuOSksIG5hLnJtPVRSVUUpKQpgYGAKCgpgYGB7cn0KIyByYW5kb20gaW50ZXJjZXB0cyArIHNsb3BlcwphaS5tYXMuZ2FtLnNsb3BlIDwtIGJhbShmMSB+IHRvbi5vcmQgKyBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzKGYwLCBicz0iY3IiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjApICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJ5PXRvbi5vcmQsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMobnVtZXJvLCBicz0icmUiKSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzKG51bWVybywgbWVhc3VyZW1lbnQubm8sIGJzPSJyZSIpLAogICAgICAgICAgICAgICAgICAgICAgICBkYXRhPWFpLm1hcywgbWV0aG9kPSJmUkVNTCIpCnN1bW1hcnkuY29lZnMoYWkubWFzLmdhbS5zbG9wZSkKYGBgCgpgYGB7cn0KcGxvdF9zbW9vdGgoYWkubWFzLmdhbS5zbG9wZSwgdmlldz0ibWVhc3VyZW1lbnQubm8iLCBjb25kPWxpc3QoZjA9MTAwKSwKICAgICAgICAgICAgcnVnPUYsIGNvbD0icmVkIikKcGxvdF9zbW9vdGgo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HRvbi5vcmQgKyBzKG1lYXN1cmVtZW50Lm5vLCBicz0iY3IiKSArCiMgICAgICAgICAgICAgICAgICAgICAgICAgICBzKGYwLCBicz0iY3IiKSArCiMgICAgICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjApICsKIyAgICAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJ5PXRvbi5vcmQsIGJzPSJjciIpICsKIyAgICAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIG51bWVybywgYnM9ImZzIiwgeHQ9ImNyIiwgbT0xLCBrPTUpLAojICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE9YWkubWFzLCBtZXRob2Q9ImZSRU1MIikKI3N1bW1hcnkuY29lZnMoYWkubWFzLmdhbS5zbW9vdGgpCmBgYAoKCmBgYHtyfQphaS5tYXMkc3RhcnQuZXZlbnQgPC0gYWkubWFzJG1lYXN1cmVtZW50Lm5vPT0wCgpyMSA8LSBzdGFydF92YWx1ZV9yaG8oYWkubWFzLmdhbS5mMCkKCmFpLm1hcy5nYW0uQVIgPC0gYmFtKGYxIH4gdG9uLm9yZCArIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMoZjAsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMCkgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnk9dG9uLm9yZCwgYnM9ImNyIiksCiAgICAgICAgICAgICAgICAgICAgICAgZGF0YT1haS5tYXMsIG1ldGhvZD0iZlJFTUwiLAogICAgICAgICAgICAgICAgICAgICAgIHJobz1yMSwgQVIuc3RhcnQ9YWkubWFzJHN0YXJ0LmV2ZW50KQpzdW1tYXJ5LmNvZWZzKGFpLm1hcy5nYW0uQVIpCmBgYAoKYGBge3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IHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyhmMCwgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZjApICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnk9dG9uLm9yZCwgYnM9ImNyIiksCiAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhPWFpLm1hcywgbWV0aG9kPSJNTCIpCnN1bW1hcnkuY29lZnMoYWkubWFzLmYyLmdhbS5mMCkKYGBgCgpgYGB7cn0KcGxvdF9zbW9vdGgoYWkubWFzLmYyLmdhbS5mMCwgdmlldz0ibWVhc3VyZW1lbnQubm8iLCBjb25kPWxpc3QoZjA9MTAwKSwKICAgICAgICAgICAgcnVnPUYsIGNvbD0icmVkIikKcGxvdF9zbW9vdGgoYWkubWFzLmYyLmdhbS5mMCwgdmlldz0ibWVhc3VyZW1lbnQubm8iLCBjb25kPWxpc3QoZjA9MTIwKSwKICAgICAgICAgICAgcnVnPUYsIGNvbD0ib3JhbmdlIiwgYWRkPVQpCnBsb3Rfc21vb3RoKGFpLm1hcy5mMi5nYW0uZjAsIHZpZXc9Im1lYXN1cmVtZW50Lm5vIiwgY29uZD1saXN0KGYwPTE0MCksCiAgICAgICAgICAgIHJ1Zz1GLCBjb2w9InllbGxvdyIsIGFkZD1UKQpwbG90X3Ntb290aChhaS5tYXMuZjIuZ2FtLmYwLCB2aWV3PSJtZWFzdXJlbWVudC5ubyIsIGNvbmQ9bGlzdChmMD0xODApLAogICAgICAgICAgICBydWc9RiwgY29sPSJncmVlbiIsIGFkZD1UKQpwbG90X3Ntb290aChhaS5tYXMuZjIuZ2FtLmYwLCB2aWV3PSJtZWFzdXJlbWVudC5ubyIsIGNvbmQ9bGlzdChmMD0yMDApLAogICAgICAgICAgICBydWc9RiwgY29sPSJibHVlIiwgYWRkPVQpCmZ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xNDApLAogICAgICAgICAgICBydWc9RiwgY29sPSJ5ZWxsb3ciLCBhZGQ9VCkKcGxvdF9zbW9vdGgoYWkubWFzLmdhbS5mMi5pbnQsIHZpZXc9Im1lYXN1cmVtZW50Lm5vIiwgY29uZD1saXN0KGYwPTE4MCksCiAgICAgICAgICAgIHJ1Zz1GLCBjb2w9ImdyZWVuIiwgYWRkPVQpCnBsb3Rfc21vb3RoKGFpLm1hcy5nYW0uZjIuaW50LCB2aWV3PSJtZWFzdXJlbWVudC5ubyIsIGNvbmQ9bGlzdChmMD0yMDApLAogICAgICAgICAgICBydWc9RiwgY29sPSJibHVlIiwgYWRkPVQpCmZ2aXNnYW0oYWkubWFzLmdhbS5mMi5pbnQsIHZpZXc9YygibWVhc3VyZW1lbnQubm8iLCJmMCIpLAogICAgICAgIHlsaW09cXVhbnRpbGUoYWkubWFzJGYwLCBjKDAuMSwgMC45KSwgbmEucm09VFJVRSkpCmBgYAoKCmBgYHtyfQojIHJhbmRvbSBpbnRlcmNlcHRzICsgc2xvcGVzCmFpLm1hcy5nYW0uZjIuc2xvcGUgPC0gYmFtKGYyIH4gdG9uLm9yZCArIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMoZjAsIGJzPSJjciIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMCkgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnk9dG9uLm9yZCwgYnM9ImNyIikgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcyhudW1lcm8sIGJzPSJyZSIpICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMobnVtZXJvLCBtZWFzdXJlbWVudC5ubywgYnM9InJlIiksCiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE9YWkubWFzLCBtZXRob2Q9ImZSRU1MIikKc3VtbWFyeS5jb2VmcyhhaS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ICAgICAgICAgcnVnPUYsIHJtLnJhbmVmPVQpCiNwbG90X2RpZmYoYWkubWFzLmdhbS5zbG9wZSwgdmlldz0ibWVhc3VyZW1lbnQubm8iLAogICAgICAgICAgI2NvbXA9bGlzdCh0b24ub3JkID0gYygiMiIsIjQiKSksIHJtLnJhbmVmPVQpCmBgYAoKCmBgYHtyfQojYWkubWFzLmdhbS5mMi5zbW9vdGggPC0gYmFtKGYxIH4gdG9uLm9yZCArIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIpICsKIyAgICAgICAgICAgICAgICAgICAgICAgICAgIHMoZjAsIGJzPSJjciIpICsKIyAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpKG1lYXN1cmVtZW50Lm5vLCBmMCkgKwojICAgICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgYnk9dG9uLm9yZCwgYnM9ImNyIikgKwojICAgICAgICAgICAgICAgICAgICAgICAgICAgcyhtZWFzdXJlbWVudC5ubywgbnVtZXJvLCBicz0iZnMiLCB4dD0iY3IiLCBtPTEsIGs9NSksCiMgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YT1haS5tYXMsIG1ldGhvZD0iZlJFTUwiKQojc3VtbWFyeS5jb2VmcyhhaS5tYXMuZ2FtLmYyLnNtb290aCkKYGBgCgoKIyMjIyBDZW50cmFsIHBvcnRpb24KClRoZSBjZW50cmFsIHBvcnRpb246CgpgYGB7cn0KYWkuY2VudHJhbC5tYXMuZjIuZ2FtLmRpZmYgPC0gYmFtKGYyIH4gdG9uLm9yZCArIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIsaz02KSArCiAgICAgICAgICAgICAgICAgICAgICAgIHMobWVhc3VyZW1lbnQubm8sIGJ5PXRvbi5vcmQsIGJzPSJjciIsaz02KSwKICAgICAgICAgICAgICAgICAgICAgIGRhdGE9YWkuY2VudHJhbC5tYXMsIG1ldGhvZD0iTUwiKQpzdW1tYXJ5LmNvZWZzKGFpLmNlbnRy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FzdXJlbWVudC5ubywgYnk9dG9uLm9yZCwgYnM9ImNyIixrPTYpLAogICAgICAgICAgICAgICAgICAgICAgZGF0YT1haS5jZW50cmFsLmZlbSwgbWV0aG9kPSJNTCIpCnN1bW1hcnkuY29lZnMoYWkuY2VudHJhbC5mZW0uZ2FtLmRpZmYpCmBgYAoKYGBge3J9CnBsb3Rfc21vb3RoKGFpLmNlbnRyYWwuZmVtLmdhbS5kaWZmLCB2aWV3PSJtZWFzdXJlbWVudC5ubyIsCiAgICAgICAgICAgIHBsb3RfYWxsPSJ0b24ub3JkIiwgcnVnPUYpCnBsb3RfZGlmZihhaS5jZW50cmFsLmZlbS5nYW0uZGlmZiwgdmlldz0ibWVhc3VyZW1lbnQubm8iLAogICAgICAgICAgY29tcD1saXN0KHRvbi5vcmQ9YygiMSIsIjIiKSkpCnBsb3RfZGlmZihhaS5jZW50cmFsLmZlbS5nYW0uZGlmZiwgdmlldz0ibWVhc3VyZW1lbnQubm8iLAogICAgICAgICAgY29tcD1saXN0KHRvbi5vcmQ9YygiMiIsIjMiKSkpCnBsb3RfZGlmZihhaS5jZW50cmFsLmZlbS5nYW0uZGlmZiwgdmlldz0ibWVhc3VyZW1lbnQubm8iLAogICAgICAgICAgY29tcD1saXN0KHRvbi5vcmQ9YygiMyIsIjQiKSkpCmBgYAoKYGBge3J9CmFpLmNlbnRyYWwuZmVtLmdhbS5kdXIgPC0gYmFtKGYxIH4gdG9uLm9yZCArIHMobWVhc3VyZW1lbnQubm8sIGJzPSJjciIsaz02KSArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMoZHVyZWUubXMuLCBicz0iY3IiLGs9NikgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aShtZWFzdXJlbWVudC5ubywgZHVyZWUubXMuLGs9NikgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzKG1lYXN1cmVtZW50Lm5vLCBieT10b24ub3JkLCBicz0iY3IiLGs9NiksCiAgICAgICAgICAgICAgICA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